package com.sw.study.javaspi;

import com.sw.study.spi.javaspi.IHelloService;

import java.util.ServiceLoader;

public class JavaSpiMain {
    public static void main(String[] args) {
        ServiceLoader<IHelloService> services= ServiceLoader.load(IHelloService.class);
        for(IHelloService helloService:services){
            System.out.println(helloService.sayHello(helloService.getClass().getName()));
        }
    }
}
